package cn.edu.lingnan.lsqn.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "t_column")
public class Column {
	private int id;
	private String name;
	private int orders;
	private Column parent;
	
	public Column(){
	}
	public Column(String name,int orders,Column parent){
		this.name = name;
		this.orders = orders;
		this.parent = parent;
	}

	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getOrders() {
		return orders;
	}

	public void setOrders(int orders) {
		this.orders = orders;
	}
	@ManyToOne
	@JoinColumn(name = "p_id")
	public Column getParent() {
		return parent;
	}

	public void setParent(Column parent) {
		this.parent = parent;
	}
}
